package com.sskj.jd.domain.entity;

import java.util.ArrayList;
import java.util.Calendar;
import java.util.List;

import javax.persistence.CascadeType;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Inheritance;
import javax.persistence.InheritanceType;
import javax.persistence.JoinColumn;
import javax.persistence.Lob;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.OrderBy;
import javax.persistence.Table;

import org.hibernate.annotations.BatchSize;

import com.sskj.core.entity.BaseEntity;
import com.sskj.eng.domain.entity.DingJianDuEng;

@Table(name = "JD_JDJL")
@Entity
@Inheritance(strategy = InheritanceType.JOINED)
@BatchSize(size = 50)
public class JianDuJiLu extends BaseEntity {

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;

	// 编码
	private String coding = "";

	// 记录日期
	private Calendar jlrq = null;

	// 记录类型Code
	private String jllx = "";

	// 路由页面
	private String router = "";

	// 记录类型名称
	private String jllxName = "";

	// 形象进度
	private String xxjdms = "";
	
	// 形象进度
	private String xxjd = "";	

	// 监督工程
	@ManyToOne(cascade = CascadeType.ALL, fetch = FetchType.LAZY)
	@JoinColumn(name = "engId", nullable = true)
	private DingJianDuEng eng;

	// 发现问题
	@OneToMany(cascade = { CascadeType.ALL }, fetch = FetchType.LAZY, mappedBy = "jdjl", orphanRemoval = true)
	@BatchSize(size = 50)
	private List<FoundWT> wt = new ArrayList<FoundWT>();

	// 监督人员
	@OneToMany(cascade = { CascadeType.ALL }, fetch = FetchType.LAZY, mappedBy = "jdjl", orphanRemoval = true)
	@BatchSize(size = 50)
	private List<JianDuJiLuRenYuan> jdrys = new ArrayList<JianDuJiLuRenYuan>();

	// 记录机构
	@OneToMany(cascade = { CascadeType.ALL }, fetch = FetchType.LAZY, mappedBy = "jdjl", orphanRemoval = true)
	@BatchSize(size = 50)
	@OrderBy("sort")
	private List<JianDuJiLuCJJG> cjjgs = new ArrayList<JianDuJiLuCJJG>();

	// 图片
	@OneToMany(cascade = { CascadeType.ALL }, fetch = FetchType.LAZY, mappedBy = "jdjl", orphanRemoval = true)
	@BatchSize(size = 50)
	@OrderBy("sort")
	private List<WenTiIMG> images = new ArrayList<WenTiIMG>();

	// 地图
	@ManyToOne(cascade = CascadeType.ALL, fetch = FetchType.LAZY)
	@JoinColumn(name = "mapId", nullable = true)
	private JiLuMap map;

	// 文本
	@Lob
	private String note;

	@Lob
	private String jdyj;

	// 是否上传
	private Boolean isUpload = false;

	// 是否删除
	private Boolean isDel = false;

	public Calendar getJlrq() {
		return jlrq;
	}

	public void setJlrq(Calendar jlrq) {
		this.jlrq = jlrq;
	}

	/**
	 * @return the eng
	 */
	public DingJianDuEng getEng() {
		return eng;
	}

	/**
	 * @return the wt
	 */
	public List<FoundWT> getWt() {
		return wt;
	}

	/**
	 * @param eng
	 *            the eng to set
	 */
	public void setEng(DingJianDuEng eng) {
		this.eng = eng;
	}

	/**
	 * @param wt
	 *            the wt to set
	 */
	public void setWt(List<FoundWT> wt) {
		this.wt = wt;
	}

	/**
	 * @return the map
	 */
	public JiLuMap getMap() {
		return map;
	}

	/**
	 * @param map
	 *            the map to set
	 */
	public void setMap(JiLuMap map) {
		this.map = map;
	}

	/**
	 * @return the jdrys
	 */
	public List<JianDuJiLuRenYuan> getJdrys() {
		return jdrys;
	}

	/**
	 * @param jdrys
	 *            the jdrys to set
	 */
	public void setJdrys(List<JianDuJiLuRenYuan> jdrys) {
		this.jdrys = jdrys;
	}

	/**
	 * @return the jllx
	 */
	public String getJllx() {
		return jllx;
	}

	/**
	 * @return the jllxName
	 */
	public String getJllxName() {
		return jllxName;
	}

	/**
	 * @param jllx
	 *            the jllx to set
	 */
	public void setJllx(String jllx) {
		this.jllx = jllx;
	}

	/**
	 * @param jllxName
	 *            the jllxName to set
	 */
	public void setJllxName(String jllxName) {
		this.jllxName = jllxName;
	}

	/**
	 * @return the coding
	 */
	public String getCoding() {
		return coding;
	}

	/**
	 * @param coding
	 *            the coding to set
	 */
	public void setCoding(String coding) {
		this.coding = coding;
	}

	/**
	 * @return the isUpload
	 */
	public Boolean getIsUpload() {
		return isUpload;
	}

	/**
	 * @param isUpload
	 *            the isUpload to set
	 */
	public void setIsUpload(Boolean isUpload) {
		this.isUpload = isUpload;
	}

	/**
	 * @return the xxjdms
	 */
	public String getXxjdms() {
		return xxjdms;
	}

	/**
	 * @param xxjdms
	 *            the xxjdms to set
	 */
	public void setXxjdms(String xxjdms) {
		this.xxjdms = xxjdms;
	}

	/**
	 * @return the note
	 */
	public String getNote() {
		return note;
	}

	/**
	 * @param note
	 *            the note to set
	 */
	public void setNote(String note) {
		this.note = note;
	}

	/**
	 * @return the cjjgs
	 */
	public List<JianDuJiLuCJJG> getCjjgs() {
		return cjjgs;
	}

	/**
	 * @param cjjgs
	 *            the cjjgs to set
	 */
	public void setCjjgs(List<JianDuJiLuCJJG> cjjgs) {
		this.cjjgs = cjjgs;
	}

	/**
	 * @return the router
	 */
	public String getRouter() {
		return router;
	}

	/**
	 * @param router
	 *            the router to set
	 */
	public void setRouter(String router) {
		this.router = router;
	}

	public Boolean getIsDel() {
		return isDel;
	}

	public void setIsDel(Boolean isDel) {
		this.isDel = isDel;
	}

	public List<WenTiIMG> getImages() {
		return images;
	}

	public void setImages(List<WenTiIMG> images) {
		this.images = images;
	}

	public String getJdyj() {
		return jdyj;
	}

	public void setJdyj(String jdyj) {
		this.jdyj = jdyj;
	}

	public String getXxjd() {
		return xxjd;
	}

	public void setXxjd(String xxjd) {
		this.xxjd = xxjd;
	}

}
